﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace XYX.Http.Mvc
{
    //没用缓存
    public class ActionMethodSelector
    {
        /// <summary>
        ///所有的方法
        /// </summary>
        public MethodInfo[] ActionMethods { get; private set; }
        /// <summary>
        /// 控制器类型
        /// </summary>
        public Type ControllerType { get; private set; }

        /// <summary>
        /// 构造
        /// </summary>
        /// <param name="controllerType"></param>
        public ActionMethodSelector(Type controllerType)
        {
            ControllerType = controllerType;
            var allMethods = ControllerType.GetMethods(BindingFlags.InvokeMethod | BindingFlags.Instance | BindingFlags.Public);
            ActionMethods = allMethods;
        }
    }
}
